<?php
class Server {
  public static function delete_obj($orm, $sys, $inst, $is_iframe) {
    $req = json_decode(Utils::get_param('req', '[]'));
    if (file_exists($req->file)) {
      unlink($req->file);
    }
    $orm->delete('pb_ecom_hm_banner', $req);
    $res = $orm->get('pb_ecom_hm_banner', NULL, NULL, NULL, NULL, NULL)->d;
    echo json_encode($res);
  }
  
  public static function update_objs($orm, $sys, $inst, $is_iframe) {
    $reqs = json_decode(Utils::get_param('reqs', '[]'));
    foreach ($reqs as &$itm) {
      $orm->update('pb_ecom_hm_banner', $itm);
    }
  }
}
?>